import { createBrowserRouter } from 'react-router-dom';
import Layout from '../layouts/BasicLayout';
import Login from '../pages/Login';
import Dashboard from '../pages/Dashboard';
import PartyMemberList from '../pages/party-member/List';
import PartyMemberForm from '../pages/party-member/Form';
import SalaryList from '../pages/salary/List';
import SalaryForm from '../pages/salary/Form';
import PartyFeeCalculation from '../pages/party-fee/Calculation';
import PartyFeeResult from '../pages/party-fee/Result';
import AuthRoute from '../components/AuthRoute';

const router = createBrowserRouter([
  {
    path: '/login',
    element: <Login />,
  },
  {
    path: '/',
    element: (
      <AuthRoute>
        <Layout />
      </AuthRoute>
    ),
    children: [
      {
        path: '/',
        element: <Dashboard />,
      },
      {
        path: '/party-members',
        element: <PartyMemberList />,
      },
      {
        path: '/party-members/new',
        element: <PartyMemberForm />,
      },
      {
        path: '/party-members/:id/edit',
        element: <PartyMemberForm />,
      },
      {
        path: '/salaries',
        element: <SalaryList />,
      },
      {
        path: '/salaries/new',
        element: <SalaryForm />,
      },
      {
        path: '/salaries/:id/edit',
        element: <SalaryForm />,
      },
      {
        path: '/party-fee/calculation',
        element: <PartyFeeCalculation />,
      },
      {
        path: '/party-fee/result',
        element: <PartyFeeResult />,
      },
    ],
  },
]);

export default router; 